<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>通过方法得到当前时间{{getCurrentTime()}}</p>
        <p>通过属性得到当前时间{{getCurrentTime1}}</p>
        <p>属性是静态的，也就是不刷新页面，getCurrentTime1的值是不变的,一般用于值不变的</p>
    </div>
    <script>
        var vm=new Vue({
            el:"#app",
            methods:{
                getCurrentTime:function () {
                    return new Date();
                }
            },
           computed:{
                getCurrentTime1:function () {
                    return new Date();
                }
            }
        });
    </script>
</body>
</html>